package com.zunipe.minix;

import com.zunipe.ZunipeTools;
import com.zunipe.until.Util;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.BookScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(BookScreen.class)
public class BookScreenMixin
{
    @Shadow
    private BookScreen.Contents contents;

    @Inject(method = "init", at = @At("RETURN"))
    private void init(CallbackInfo info)
    {
        String message = contents.getPage(0).getString();
        if (Util.firstLogin && message.contains("为了防止有可能的作弊") && message.contains("客户端，外挂等") && message.contains("请您点击下方的蓝色文字") && message.contains("[点击验证]"))
        {
            MinecraftClient.getInstance().player.sendChatMessage(".say C2de243dsSW68Ff31s4");
            Util.firstLogin = false;
        }
    }
}
